package com.starview.star.operators.arith;

import com.starview.platform.data.type.IType;
import com.starview.platform.data.type.StandardTypes;
import com.starview.platform.data.type.TypeUtils;
import com.starview.star.operators.Builtin;
import com.starview.star.operators.Intrinsics;
import com.starview.star.operators.arith.runtime.IntUnary.IntAbs;
import com.starview.star.operators.arith.runtime.IntUnary.IntCbrt;
import com.starview.star.operators.arith.runtime.IntUnary.IntCeil;
import com.starview.star.operators.arith.runtime.IntUnary.IntExp;
import com.starview.star.operators.arith.runtime.IntUnary.IntFloor;
import com.starview.star.operators.arith.runtime.IntUnary.IntLog;
import com.starview.star.operators.arith.runtime.IntUnary.IntLog10;
import com.starview.star.operators.arith.runtime.IntUnary.IntRandom;
import com.starview.star.operators.arith.runtime.IntUnary.IntRound;
import com.starview.star.operators.arith.runtime.IntUnary.IntSqrt;
import com.starview.star.operators.arith.runtime.IntUnary.IntUMinus;



public abstract class IntUnary
{
  public static final String UMINUS = "__integer_uminus";

  public static void declare(Intrinsics cxt)
  {
    IType intType = StandardTypes.rawIntegerType;
    IType type = TypeUtils.functionType(intType, intType);
    cxt.declareBuiltin(new Builtin("__integer_abs", type, IntAbs.class));
    cxt.declareBuiltin(new Builtin(UMINUS, type, IntUMinus.class));
    cxt.declareBuiltin(new Builtin("__integer_random", type, IntRandom.class));
    cxt.declareBuiltin(new Builtin("__integer_sqrt", type, IntSqrt.class));
    cxt.declareBuiltin(new Builtin("__integer_cbrt", type, IntCbrt.class));
    cxt.declareBuiltin(new Builtin("__integer_ceil", type, IntCeil.class));
    cxt.declareBuiltin(new Builtin("__integer_floor", type, IntFloor.class));
    cxt.declareBuiltin(new Builtin("__integer_round", type, IntRound.class));
    cxt.declareBuiltin(new Builtin("__integer_log", type, IntLog.class));
    cxt.declareBuiltin(new Builtin("__integer_log10", type, IntLog10.class));
    cxt.declareBuiltin(new Builtin("__integer_exp", type, IntExp.class));
  }
}
